#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int* dp = (int*)calloc(n + 1, sizeof(int));
	int** r = (int**)malloc((n + 1) * sizeof(int*));
	for (int i = 1; i <= n; ++i)
	{
		r[i] = (int*)calloc(n + 1, sizeof(int));
		for (int j = i + 1; j <= n; ++j)
		{
			scanf("%d", &r[i][j]);
		}
		dp[i] = (int)1e6;
	}
	dp[n] = 0;
	for(int i = n-1;i>=1;--i)
		for (int j = i + 1; j <= n; ++j)
		{
			dp[i] = (int)fmin(dp[i], r[i][j] + dp[j]);
		}
	printf("%d", dp[1]);
	return 0;
}